﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Max and min number</title>
    <link href="styles/js-console.css" rel="stylesheet" />
</head>
<body>
    <div id="js-console"></div>
	<script src="scripts/js-console.js"></script>
    
    <script>
        var n = 9;
        var minimalValue = 0; 
        var maximalValue=minimalValue;
        var number;
        var myNumbers = new Array(5, 6, 1, 25, 14, 100, 0, 1000, 800);

        for (var i = 1; i < myNumbers.length; i++) {
            number = myNumbers[i];

            if (maximalValue < number) {
            
                    maximalValue = number;
            }
            if (minimalValue > number) {
           
                    minimalValue = number;
            }
        }
        jsConsole.writeLine("The maximal value of the sequence is:" + maximalValue);
        jsConsole.writeLine("The minimal value of the sequence is:" + minimalValue);

    </script>
</body>
</html>
